<template>
	<view class="box">
		<view class="header">
			<view class="headPortrait">
				<image :src="userDetails.avatarAddress ? userDetails.avatarAddress : '../../../static/img/headFeature/member/defaultTx.png'"></image>
			</view>
			<view class="name">{{userDetails.realName ? userDetails.realName : ''}} {{userDetails.age ? userDetails.age : ''+'岁'}}
			（{{userDetails.sex == 1 ? '男' : userDetails.sex == 2 ? '女' : userDetails.sex == 3 ?'未知' : ''}}） </view>
			<view class="together">
				<view class="togetherItem">
					<view class="expertNameOne">健管师</view>
					<view>：{{userDetails.healthName}} {{userDetails.appellations}}</view>
				</view>
				<view class="togetherItem">
					<view class="expertName">专家</view>
					<view>：</view>
					<view class="nameOfExpert" v-if="userDetails.expertList">
						<view  v-for="(item,index) in userDetails.expertList" :key="index" class="placeholder">
							<view class="viewBox">{{item.expertName}} {{item.appellations || '未预约专家'}}</view>
						</view>
					</view>
					<view class="nameOfExpert" v-else>
						<view class="placeholder">未预约专家</view>
					</view>
				</view>
			</view>
		</view>
		
		<!-- 监测评估 -->
		<view class="monitoring">
			<!--监测评估-->
			<view class="quicklyCreate">
				<view class="navigation">
					<image src="../../../static/img/index/tips@2x.png"></image>
					<text>监测评估</text>
				</view>
				<view class="itemBox">
					<navigator :url="'/pages/headFeatures/userInformation/informationlist?userId='+userId" class="item">
						<image src="../../../static/img/headFeature/member/memberInformation@2x.png"></image>
						<text>基本信息<br>列表</text>
					</navigator>
					<navigator :url="'/pages/headFeatures/userAssessment/list?userId='+userId" class="item">
						<image src="../../../static/img/headFeature/member/healthQuestion@2x.png"></image>
						<text>健康问卷<br>列表</text>
					</navigator>
					<navigator :url="'/pages/headFeatures/userReport/list?userId='+userId" class="item">
						<image src="../../../static/img/headFeature/member/medicalReport@2x.png"></image>
						<text>体检报告<br>列表</text>
					</navigator>
					<navigator :url="'/pages/headFeatures/userSummary/list?userId='+userId+'&sex='+userDetails.sex" class="item">
						<image src="../../../static/img/headFeature/member/healthIssues@2x.png"></image>
						<text>评估报告<br>列表</text>
					</navigator>
					<navigator :url="'/pages/headFeatures/member/dailyMonitoring?userId='+userId" class="item">
						<image src="../../../static/img/headFeature/member/dailyMonitoring@2x.png"></image>
						<text>日常监测</text>
					</navigator>
					<navigator :url="'/pages/headFeatures/doctor/list?userId='+userId+'&sex='+userDetails.sex" class="item">
						<image src="../../../static/img/headFeature/member/goDoctor@2x.png"></image>
						<text>就医记录</text>
					</navigator>
					<navigator :url="'/pages/headFeatures/medication/list?userId='+userId" class="item">
						<image src="../../../static/img/headFeature/member/medicalRecords@2x.png"></image>
						<text>用药记录</text>
					</navigator>
				</view>
			</view>
			
			<!-- 健康干预 -->
			<view class="quicklyCreate">
				<view class="navigation">
					<image src="../../../static/img/index/tips@2x.png"></image>
					<text>健康干预</text>
				</view>
				<view class="itemBox">
					<navigator :url="'/pages/headFeatures/userIntervention/list?userId='+userId" class="item">
						<image src="../../../static/img/headFeature/member/interventionPlan.png"></image>
						<text>干预方案</text>
					</navigator>
					<navigator :url="'/pages/headFeatures/userInterventionPlan/list?userId='+userId" class="item">
						<image src="../../../static/img/headFeature/member/intervention@2x.png"></image>
						<text>干预计划</text>
					</navigator>
					<navigator :url="'/pages/headFeatures/userFollow/followlist?userId='+userId" class="item">
						<image src="../../../static/img/headFeature/member/followUp@2x.png"></image>
						<text>随访记录</text>
					</navigator>
					<navigator :url="'/pages/headFeatures/userReferral/referrallist?userId='+userId" class="item">
						<image src="../../../static/img/headFeature/member/referralRecord@2x.png"></image>
						<text>转诊记录</text>
					</navigator>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getUrlParam,age} from "@/static/js/filter.js";
	export default {
		data() {
			return {
				userId: '',
				userDetails: {},
			}
		},
		onLoad() {
			this.userId = getUrlParam('userId');
			if(this.userId) {
				this.$api.userDetileId(this.userId).then((res) => {
					if(res.data.returnCode == 200) {
						this.userDetails = res.data.result,
						this.userDetails.age = age(this.userDetails.idCard)
					}
					
				})
			}
		},
		methods:{
			age,
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/static/css/headFeatures/member/memberDetail.scss';
</style>
